﻿<!--#include file="app/inc/conn.asp"-->
<!--#include file="app/inc/md5.asp"-->
<%Call GetConfig()%>
<!DOCTYPE html>
<!--[if lt IE 7]><html lang="zh-CN" class="ie6 ielt8"><![endif]--> 
<!--[if IE 7]><html lang="zh-CN" class="ie7 ielt8"><![endif]--> 
<!--[if IE 8]><html lang="zh-CN" class="ie8"><![endif]--> 
<!--[if (gte IE 9)|!(IE)]><!--><html lang="zh-CN"><!--<![endif]--> 
<head>
<meta charset="utf-8">
<title>老板，给点吧，打发点咯……</title>
<link href="<%=sitepath%>theme/css/common.css" rel="stylesheet">
<!--[if IE]><script src="<%=sitepath%>theme/js/html5.js"></script><![endif]-->
<script src="<%=sitepath%>theme/js/modernizr.js"></script>
<script src="<%=sitepath%>theme/js/jquery.js"></script>
<script src="<%=sitepath%>theme/js/common.js"></script>
</head>
<%
Call OpenData()
Set rsSum = conn.execute("select top 1 [sum] from [config] where id>0")
if not rsSum.eof then
	sumArr = split(rsSum("sum"),",")
	for i = 0 to ubound(sumArr)
		sumHTML = sumHTML & "<li><input type=""radio"" class=""input-sum"" name=""sum"" id=""sum"&i&""" value="""&sumArr(i)&"""><label class=""chk"" for=""sum"&i&""">"&sumArr(i)&"</label></li>"
	next
else
	response.write("<h1>站点尚未配置完成，请到后台配置</h1>")
end if
Set rsSum = nothing

'sql
'fWord = request("w")
sql = sql & "select id,[sum],says,username,email,paytime,url from [donate-list] where status=true"
'qStr = ""
'If fWord <> "" Then sql = sql & " and (username like '%"&Trim(fWord)&"%' or alipay like '%"&Trim(fWord)&"%' or email like '%"&Trim(fWord)&"%' or url like '%"&Trim(fWord)&"%')" : qStr = qStr & "&w="&fWord
sql = sql & " order by paytime desc"
'response.write sql :response.end
set rs = server.CreateObject("adodb.recordset")
rs.open sql,conn,1,1
If Not rs.eof Then
'分页
dim currentpage
maxperpage=30 '信息显示条数
rs.pagesize=maxperpage
currentpage=request.queryString("p")
if currentpage="" or not isnumeric(currentpage) then
	currentpage=1
elseif currentpage<1 then
	currentpage=1
else
	currentpage=clng(currentpage)
	if currentpage > rs.pageCount Then currentpage=rs.pageCount
end if
			  
dim totalput,n
totalput=rs.recordcount
if totalput mod maxperpage=0 then
	n=totalput\maxperpage
else
	n=totalput\maxperpage+1
end if
if n = 0 then n = 1
rs.move(currentpage-1)*maxperpage
i = 0
do while i < maxperpage and not rs.eof
	id = rs("id")
	sum = rs("sum")
	'alipay = rs("alipay")
	username = rs("username")
	email = md5(rs("email"),32)
	'ordertime = rs("ordertime")
	paytime = rs("paytime")
	url = rs("url")
	says = rs("says")
	If url = "" Then 
		url = "#"
	End if
		str = str & "<li itemscope itemtype=""http://data-vocabulary.org/Person"">"
		str = str & "<a href='"&url&"' class='avatar'><img itemprop=""photo"" src='http://www.gravatar.com/avatar/"&email&"'></a>"
		str = str & "<div class='detail'>"
		str = str & "<p><a href='"&url&"' class='fn' itemprop=""name url"">"&username&"</a>于<time datetime='"&paytime&"'>"&year(paytime)&"-"&month(paytime)&"-"&day(paytime)&"</time>向他捐赠<strong class='sum'>"&sum&"</strong>&yen;</p>"
		str = str & "<p class='says'>"&says&"<i class='arrow'></i><i class='arrow-inner'></i></p>"
		str = str & "</div></li>"
		'str = str & "<tr><td class='chk'><input type='checkbox' name='id' value='"&id&"' /></td><td class='t'><a href='donate-datail.asp?id="&id&"'>"&username&"</a></td><td class='t'>"&sum&"</td><td>"&alipay&"</td><td>"&email&"</td><td>"&year(ordertime)&"-"&month(ordertime)&"-"&day(ordertime)&"</td><td>"&year(paytime)&"-"&month(paytime)&"-"&day(paytime)&"</td><td><a href='action.asp?app=donate&act=edit&id="&id&"&act=edit'>编辑</a> <a href='javascript:;' onclick='del("&id&")'>删除</a></td></tr>"
	i=i+1      
	rs.movenext
Loop
Else
	str = "<li>没有捐赠记录！</li>"
End if
rs.close:set rs = nothing
'page
pageCount = n
If currentpage>1 Then 
	pageStr = pageStr & "<a href='?p="&currentpage-1&qStr&"'>&laquo; 上一页</a>"
Else
	pageStr = pageStr & "<span class='disabled'>&laquo; 上一页</span>"
End if
If pageCount<=10 Then
	For i = 1 To pageCount
		If i = currentpage Then 
			pageStr = pageStr & "<span class='current'>"&i&"</span>"
		Else
			pageStr = pageStr & "<a href='?p="&i&qStr&"'>"&i&"</a>"
		End if
	Next
else
	For i = 1 To 2
		If i = currentpage Then 
			pageStr = pageStr & "<span class='current'>"&i&"</span>"
		Else
			pageStr = pageStr & "<a href='?p="&i&qStr&"'>"&i&"</a>"
		End if
	Next
	If currentpage>6 Then 
		pageStr = pageStr & "..."
	End if

	ks =  currentpage-3
	If ks <1 Then ks =1
	For i = ks To currentpage+3
		If i>=pageCount-1 Then Exit For
		If i>2 Then  
			If i = currentpage Then 
				pageStr = pageStr & "<span class='current'>"&i&"</span>"
			Else
				pageStr = pageStr & "<a href='?p="&i&qStr&"'>"&i&"</a>"
			End if
		End If
	Next

	If pageCount-1-(currentpage+3)>1  Then
		pageStr = pageStr & "..."
	End if

	For i = pageCount-1 To pageCount
		If i = currentpage Then 
			pageStr = pageStr & "<span class='current'>"&i&"</span>"
		Else
			pageStr = pageStr & "<a href='?p="&i&qStr&"'>"&i&"</a>"
		End if
	Next
End if

If currentpage<pageCount Then 
	pageStr = pageStr & "<a href='?p="&currentpage+1&qStr&"'>下一页 &raquo;</a>"
Else
	pageStr = pageStr & "<span class='disabled'>下一页 &raquo;</span>"
End If

%>
<body>
<section class="page" itemscope itemtype="http://data-vocabulary.org/Event">
	<article class="page-inner">
		<header class="page-hd">
			<hgroup>
				<h1 class="logo"><a href="/" class="hide-txt"><%=site%><sup>爱心捐赠平台</sup></a></h1>
				<h2 class="slogan hide-txt">让朋友一起帮你<span itemprop="eventType">实现梦想</span></h2>
			</hgroup>
			<nav class="nav" role="navigation">
				<a href="" class="first cur">首页</a><i class="split-line">|</i><a href="">创建一个梦想</a><i class="split-line">|</i><a href="">生成互助页面</a><i class="split-line">|</i><a href="">获取支付接口代码</a>
			</nav>
		</header>
		<section class="page-bd">
			<article class="topic">
				<h3 itemprop="summary"><%=topic%></h3>
				<p class="detail" itemprop="description"><i class="icon-quot quot-start"></i><%=topicdetail%><i class="icon-quot quot-end"></i></p>
				<p class="guide"><i class="btn-guide"></i></p>
			</article>
			<form class="donate cf" action="<%=sitepath%>app/donate/index.asp" method="post" role="complementary">
				<fieldset class="sum-list">
					<legend>选择捐赠金额：</legend>
					<ul class="list">
						<%=sumHTML%>
						<li class="others"><p class="entry-def"><input type="radio" class="input-sum" name="sum" id="sum8" value="0"><label class="chk-custom" for="sum8">其他</label></p><p class="entry-box none"><input class="input-txt" type="text" onkeyup="value=value.replace(/[^0123456789.]/g,'')"><span class="action"><button class="btn btn-done" type="button">确定</button></span></p></li>
					</ul>
				</fieldset>
				<fieldset class="user-info">
					<legend>您的信息：</legend>
					<p class="donate-sum">您将捐赠<span class="price"><strong class="value">245</strong></span>元</p>
					<p class="item"><label class="tips">你的大名<i class="arrow"></i></label><input class="input-txt" type="text" name="name" placeholder="您的大名" required></p>
					<p class="item"><label class="tips">常用邮箱<i class="arrow"></i></label><input class="input-txt" type="email" name="email" placeholder="您的邮箱" required></p>
					<p class="item"><label class="tips">个人主页<i class="arrow"></i></label><input class="input-txt" type="url" name="url" placeholder="http://"></p>
					<p class="item"><label class="tips">说点什么<i class="arrow"></i></label><textarea class="input-txt input-says" rows="2" cols="28" name="says">今儿大爷真高兴啊，赏点给你</textarea></p>
					<p class="item action"><button class="btn btn-donate" type="submit"><i class="icon-alipay"></i>用支付宝帮他</button></p>
				</fieldset>
			</form>
			<article class="donate-list">
				<ol class="list" role="main">
					<%=Str%>
				</ol>
				<section class="pages">
					<%=pageStr%>
				</section>
			</article>
		</section>
		<footer class="page-ft" role="contentinfo">
			<nav role="navigation"><a href="">关于</a>|<a href="">声明</a>|<a href="">帮助</a>|<a class="join" href="http://isux.tencent.com/jobs#fed" title="腾讯ISUX招聘前端开发工程师"><strong>ISUX</strong><i class="icon-isux"></i></a></nav>
			<small class="copyright">© 2011 geidianba.com</small>
		</footer>
	</article>
</section>
<%Call CloseData%>
</body>
</html>
